﻿using Quartz;
using MailKit.Net.Smtp;
using MailKit;
using MimeKit;
using System.Threading.Tasks;
using NetTaste;
using System.IO;
using System;

public class TestJob : IJob
{
    public Task Execute(IJobExecutionContext context)
   {
        //地址
        string path = "D:\\qxAPI\\Test\\log.txt";
        //写入内容
        string boby = "写入内容test";
        if (!File.Exists(path))
        {
            Console.WriteLine("文件不存在！");
        }
        else
        {
            try
            {
                using (StreamWriter writer = new StreamWriter(path, true))
                {
                    writer.WriteLine(boby + "时间：" + DateTime.Now);
                }
            }
            catch (System.Exception ex)
            {

                System.Console.WriteLine("发生错误！");
            }
        }
            return Task.CompletedTask;

    }
}